<!-- File: /app/views/education_experiences/index.ctp -->
<h1>
    Istruzione e formazione
    <?php echo $person['Person']['surname'].' '.$person['Person']['name'] ?>
</h1>
<table class="contentTable">
	<tr>
		<th>Da</th>
		<th>A</th>
                <th>Azienda/Ente</th>
		<th></th>
	</tr>

	<!-- Here is where we loop through our $posts array, printing out post info -->
        <!-- la variabile posts l'ho settata nel controller Post -->
	<?php foreach ($educationExperiences as $educationExperience): ?>
	<tr>
		<td><?php echo $educationExperience['EducationExperience']['from']; ?></td>
                <td><?php echo $educationExperience['EducationExperience']['to']; ?></td>
                <td>
                <?php
                    echo $educationExperience['Organization']['name'];
                ?>
		</td>
                <td>
                    <!-- uses the HtmlHelper to prompt the user with a JavaScript
                         confirmation dialog before they attempt to delete a post. -->
                    <?php echo $html->link('Modifica', array('action' => 'edit', $educationExperience['EducationExperience']['id']))?>
                    <?php echo $html->link('Delete', array(
                                                'action' => 'delete',
                                                $educationExperience['EducationExperience']['id'], $person['Person']['id']),
                                                null,
                                                'Procedendo si eliminerà definitivamente l\'esperienza di istruzione/formazione. Continuare?' )?>

                </td>
		<td><?php //echo $curriculum['XmlFile']['created']; ?></td>
	</tr>
	<?php endforeach; ?>

</table>
<div class="footer_buttons">
<?php echo $html->link('Aggiungi esperienza di istruzione/formazione',array('controller' => 'EducationExperiences', 'action' => 'add', $person['Person']['id']), array('class' => 'button'))?>
<?php 
    if($from != 'edit_personal') {
        echo $html->link('Procedi',array(
                        'controller' => 'LanguageExperiences', 
                        'action' => 'index', 
                        $person['Person']['id']), 
                        array('class' => 'button'));
    }       
?>
<?php 
    
    if($from == 'edit_personal') {
        echo $html->link('Torna indietro',
                        array('controller' => 'people', 'action' => 'edit_personal'), 
                        array('class' => 'button'));
    }
    else {
        echo $html->link('Torna alla home',
                        array('controller' => 'People', 'action' => 'list_all'), 
                        array('class' => 'button'));
    }
    ?>
</div>